<template>
  <div class="index-container">
    <div class="sidebar">
      <Sidebar></Sidebar>
    </div>
    <div class="index-box">
      <div class="header">
        <Header></Header>
      </div>
      <div class="body">
        <RouterView></RouterView>
      </div>
    </div>
  </div>
</template>

<script setup name="IndexPage">
import Header from '../components/Header.vue'
import Sidebar from '../components/Sidebar.vue'
import { onBeforeUnmount } from 'vue'
import { useChart } from '../hooks/useChart'
const { closeSocket } = useChart()

onBeforeUnmount(() => {
  closeSocket()
})
</script>

<style lang="less" scoped>
.index-container {
  width: 100%;
  height: 100%;
  display: flex;
  .sidebar {
    width: 5%;
    height: 100%;
  }
  .index-box {
    width: 95%;
    height: 100%;
    .header {
      width: 100%;
      height: 10%;
    }
    .body {
      width: 100%;
      height: 90%;
    }
  }
}
</style>
